package com.hopedove.workshop.ui

import android.os.Bundle
import androidx.databinding.DataBindingUtil
import com.hopedove.base.BaseActivity
import com.hopedove.workshop.R
import com.hopedove.workshop.databinding.WorkshopHomeActivityBinding
import com.hopedove.workshop.viewmodel.WorkshopHomeViewModel
import org.koin.androidx.viewmodel.ext.android.viewModel

/**
 *  生产车间模块 - 首页
 *
 *  选择功能：运转情况，换批确认
 */
class WorkshopHomeActivity : BaseActivity() {

    private lateinit var binding: WorkshopHomeActivityBinding
    private val viewModel: WorkshopHomeViewModel by viewModel()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = DataBindingUtil.setContentView(this, R.layout.workshop_home_activity)
        binding.vm = viewModel

        setViewModelObservers()
    }

    private fun setViewModelObservers() {
        observeLoading(viewModel.loading)
        observeNavigation(viewModel.navigation)
    }

}